package cn.dzh.dal.mapper;


import cn.dzh.model.bean.*;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

/**
* @author Admin
* @description 针对表【commodity_operate(商品操作表)】的数据库操作Mapper
* @createDate 2023-10-23 11:23:57
* @Entity cn.dzh.bean.CommodityOperate
*/
@Mapper
public interface CommodityOperateMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(CommodityOperate record);

    int insertSelective(CommodityOperate record);

    CommodityOperate selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(CommodityOperate record);

    int updateByPrimaryKey(CommodityOperate record);


    @Insert("insert into exchange_price " +
            "values(#{goodsId},#{priceType},#{integralPrice},#{cashPrice},#{exchangeLimit},#{exchangeUpperLimit},#{stock})")
    int addToExchangePrice(CommodityDraft commodityDraft);

    @Insert("insert into service_terms " +
            "values(#{goodsId},#{supplierName},#{contact},#{serviceGuarantee})")
    int addToServiceTerm(CommodityDraft commodityDraft);


    @Insert("insert into commodity_base " +
            "values(#{goodsId},#{goodsName},#{goodsHeadPic},#{goodsDescription},#{goodsType},#{goodsDetail},#{goodsCategory},'无',#{auditStatus},'上线')")
    int addToBaseTab(CommodityDraft commodityDraft);

}
